package interfaceCustomer;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class CreateOrderPanel extends JPanel implements ActionListener {
	private JLabel lblCusId, lblCusName, lblCarId;
	private JTextField txtCusId, txtCusName, txtCarId;
	private JButton btnBackToMenu, btnNext;
	private CustomerFrame BackToMenu;

	public CreateOrderPanel(CustomerFrame cf) {
		
		BackToMenu = cf;
		this.setLayout(null);
	  // this.getContentPane().setBackground(Color.LIGHT_GRAY);

		btnBackToMenu = new JButton("Back To Menu");
		btnBackToMenu.setBounds(45, 215, 115, 25);
		this.add(btnBackToMenu);
		btnBackToMenu.addActionListener(this);

		btnNext = new JButton("Next");
		btnNext.setBounds(350, 215, 115, 25);
		this.add(btnNext);
		btnNext.addActionListener(this);

		lblCusId = new JLabel("Customer ID:");
		lblCusId.setBounds(10, 10, 75, 25);
		this.add(lblCusId);

		lblCarId = new JLabel("Car ID:");
		lblCarId.setBounds(455, 10, 75, 25);
		this.add(lblCarId);

		lblCusName = new JLabel("Customer Name:");
		lblCusName.setBounds(224, 10, 97, 25);
		this.add(lblCusName);

		txtCusName = new JTextField();
		txtCusName.setBounds(326, 12, 120, 20);
		this.add(txtCusName);

		txtCarId = new JTextField();
		txtCarId.setBounds(500, 12, 120, 20);
		this.add(txtCarId);

		txtCusId = new JTextField();
		txtCusId.setBounds(90, 12, 120, 20);
		this.add(txtCusId);

		this.setVisible(true);

	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if (e.getSource() == btnBackToMenu) {
			BackToMenu.ChangePanel(0);
		}

		if (e.getSource() == btnNext) {
			JOptionPane.showMessageDialog(this, "Your Order Was Confraimed",
					"OK", JOptionPane.INFORMATION_MESSAGE);
			// menup.setVisible(true);
		}

	}

}